package com.example.gray.mapper;

import com.example.gray.entity.User;
import org.apache.ibatis.annotations.*;

/**
 * @author Gray 2021/12/27-17:44
 */
@Mapper
public interface UserMapper {

    @Select("select * from user where name = #{name}")
    public User getUserByName(String name);

    @Delete("delete from user where id = #{id}")
    public Integer deleteUser(Integer id);

    @Insert("insert into user(name,password,authority) values(#{name},#{password},#{authority})")
    public Integer insertUser(User user);

    @Update("update user set password = #{password} where id = #{id}")
    public Integer updateUser(User user);

}
